#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
const LL mod=100003;
LL dp[maxn];
int main(void)
{
    ///cin.tie(0);std::ios::sync_with_stdio(false);
    LL n,k;
    while(scanf("%lld%lld",&n,&k)!=EOF){
        memset(dp,0,sizeof(dp));
        dp[0]=dp[1]=1;
        for(LL i=2;i<=n;i++){
            for(LL j=1;j<=k;j++){
                if(i>=j) dp[i]=(dp[i]%mod+dp[i-j]%mod)%mod;
            }
        }
        cout<<dp[n]%mod<<endl;
    }
return 0;
}
